import java.util.Scanner;

/**
 * 从键盘输入一个5位的正整数，要求：一、求它是几位数，二、逆序打印出各位数字
 */
public class PanDuanJiWeiShu {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入一个0~99999 之间的任意数:");
        long a = sc.nextLong();
        String ss = Long.toString(a);
        char[] ch = ss.toCharArray();
        int j = ch.length;
        System.out.println(a + "是一个" + j + "位数。");
        System.out.print("按逆序输出是：");
        for (int i = j-1; i >= 0; i--) {
            System.out.print(ch[i]);
        }
    }
}
